FROM centos:latest
MAINTAINER hz7726@163.com
ENV PATH /usr/local/php/bin:/usr/local/php/sbin:/usr/local/node/bin:$PATH
RUN yum install -y wget \
&& mkdir -p /data/docker \
&& cd /data/docker \
&& wget -c http://mirrors.linuxeye.com/oneinstack-full.tar.gz && tar xzf oneinstack-full.tar.gz && ./oneinstack/install.sh --php_option 7 --phpcache_option 1 --php_extensions zendguardloader,imagick,fileinfo,redis,swoole \
&& wget https://nodejs.org/download/release/v10.10.0/node-v10.10.0-linux-x64.tar.gz \
&& tar xf node-v10.10.0-linux-x64.tar.gz \
&& mv node-v10.10.0-linux-x64 /usr/local/node \
&& curl -sL https://rpm.nodesource.com/setup_8.x | bash - \
&& wget https://github.com/yarnpkg/yarn/releases/download/v1.13.0/yarn-1.13.0-1.noarch.rpm \
&& yum install -y yarn-1.13.0-1.noarch.rpm
&& cd /usr/local/bin \
&& curl -s https://getcomposer.org/installer | php
&& chmod a+x composer.phar \    
&& composer.phar self-update \     
&& mv composer.phar composer \
&& rm -fr /usr/local/php/etc \
&& rm -fr /data/docker && yum cleal all
COPY php_etc.tar.gz /usr/local/php/etc/
RUN  cd /usr/local/php/etc/ \
    && tar xf php_etc.tar.gz
#COPY /data/php-fpm /etc/init.d/php-fpm
#COPY /data/composer /usr/local/bin/composer
#RUN chmod +x /etc/init.d/php-fpm \
#&& chkconfig --add php-fpm \
&& sed -i 's@disable_functions@;disable_functions@' /usr/local/php/etc/php.ini
CMD ['/usr/local/php/sbin/php-fpm','--fpm-config','/usr/local/php/etc/php-fpm.conf']
